﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace Cowi.ImageManager.WebServices
{
    // A lightweight class for passing back information from the tile server as XML
    [XmlInclude(typeof(PyramidInfoResponse))]
    [XmlInclude(typeof(MetadataResponse))]
    [XmlInclude(typeof(StatisticsResponse))]
    public class CTSResponse
    {
        public bool error { get; set; }
        public string errormessage { get; set; }
    }

    public class PyramidInfoResponse : CTSResponse
    {
        public List<PyramidInfo> PyramidInfos { get; set; }
    }

    public class PyramidInfo
    {
        public int epsgCode { get; set; }
        public double offsetX { get; set; }
        public double offsetY { get; set; }
        public double baseWidth { get; set; }
        public double baseHeight { get; set; }
        public int tileSize { get; set; }
        public string name { get; set; }
        public string groupName { get; set; }
        public int levels { get; set; }
        public string type { get; set; }

        public override string ToString()
        {
            return name;
        }
    }

    public class MetadataResponse : CTSResponse
    {
        public List<string> metadata;
    }

    public class StatisticsResponse : CTSResponse
    {
        public string statistics;
    }
}
